import "./App.css";
import "./assets/reset.css";
import { Route, Routes, BrowserRouter, Navigate } from "react-router-dom";
// 导入组件 首页，城市
import Home from "./pages/Home/index.js";
import CityList from "./pages/CityList/index.js";
import News from "./pages/News/index.jsx";
import Index from "./pages/Index/index.js";
import My from "./pages/My/index.js";
import SelectCity from "./pages/SelectCity";
import Map from "./pages/Map";
import GoodsInfo from "./pages/GoodsInfo";
function App() {
  return (
    <div className="app">
      <BrowserRouter>
        <Routes>
          <Route path="/home" element={<Home />}>
            <Route path="" element={<Index />} />
            <Route path="/home/cityList" element={<CityList />} />
            <Route path="/home/news" element={<News />} />
            <Route path="/home/my" element={<My />} />
          </Route>
          <Route path="/selectCity" element={<SelectCity />} />
          <Route path="/map" element={<Map />} />
          <Route path="/goodsInfo/:id" element={<GoodsInfo />} />
          <Route path="*" element={<Navigate replace to="/home" />} />
        </Routes>
      </BrowserRouter>
    </div>
  );
}

export default App;
